@layout("/common/_containers.html"){
<link href="https://pynnn.oss-cn-hangzhou.aliyuncs.com/choice_user.css?v=20200718" rel="stylesheet">
<div style="height: 100%">
    <div style="background: #6090b8;color: white;padding: 5px 10px;">病例评分</div>
    <div style="height: calc(100% - 78px);overflow: auto;padding: 20px;">
        <div style="margin-bottom: 15px;">
            @for(item in ratingItemsInfoList){
            <span>${item.ratingItems}：</span>
            <input class="ratingItemsScore" type="text" value="${item.score}">
            @}
        </div>
        <div>
            <span style="vertical-align: top;">评语：</span>
            <textarea name="caseComment" id="caseComment" style="width: 60%;padding-left: 5px;"></textarea>
        </div>
    </div>
    <div class="btnBox">
        <button class="btn" type="button" id="submission">提交</button>
        <button class="btn" type="button" onclick="parent.layer.close(parent.layer.getFrameIndex(window.name))">取消</button>
    </div>
</div>
<script>
    $("#submission").click(function () {
        var id = parent.$("#id").val();
        var caseComment = $("#caseComment").val();
        var caseScore = [];
        $(".ratingItemsScore").each(function () {
            caseScore.push($(this).val()); //这里的value就是每一个input的value值~
        });
        if (caseScore == "" || caseScore == null) {
            alert("评分不能为空！");
            return;
        }
        if (caseComment == "" || caseComment == null) {
            alert("评语不能为空！");
            return;
        }
        $.ajax({
            url: Feng.ctxPath + "/caseSelection/addCaseScore",
            type: "post",
            data: {
                "id": id,
                "caseScore": caseScore,
                "caseComment": caseComment
            },
            success: function (data) {
                Feng.success("提交成功!");
                window.parent.parent.CaseSelection.search();
                parent.layer.close(parent.layer.getFrameIndex(window.name));
            }
        });
    });
</script>
@}